import http from "../http";

function info(params: any = {}) {
	return http.myRequest({
		url: '/server/user/info',
		method: 'post',
		data: params,
	})
}

function updateAvatar(params: any = {}) {
	return http.myRequest({
		url: '/server/user/updateAvatar',
		method: 'post',
		data: params,
		header: {
			'content-type': 'application/x-www-form-urlencoded'
		}
	})
}

function updateUsername(params: any = {}) {
	return http.myRequest({
		url: '/server/user/updateUsername',
		method: 'post',
		data: params,
		header: {
			'content-type': 'application/x-www-form-urlencoded'
		}
	})
}

function bindEmail(params: any = {}) {
	return http.myRequest({
		url: '/server/user/bindEmail',
		method: 'post',
		data: params,
		header: {
			'content-type': 'application/x-www-form-urlencoded'
		}
	})
}
function unBindEmail(params: any = {}) {
	return http.myRequest({
		url: '/server/user/unBindEmail',
		method: 'post',
		data: params,
		header: {
			'content-type': 'application/x-www-form-urlencoded'
		}
	})
}
function destroy(params: any = {}) {
	return http.myRequest({
		url: '/server/user/destroy',
		method: 'post',
		data: params,
		header: {
			'content-type': 'application/x-www-form-urlencoded'
		}
	})
}
function destroyRedirect(params: any = {}) {
	return http.myRequest({
		url: '/server/user/destroyRedirect',
		method: 'post',
		data: params,
	})
}
function setPassword(params: any = {}) {
	return http.myRequest({
		url: '/server/user/setPassword',
		method: 'post',
		data: params,
		header: {
			'content-type': 'application/x-www-form-urlencoded'
		}
	})
}
function updatePassword(params: any = {}) {
	return http.myRequest({
		url: '/server/user/updatePassword',
		method: 'post',
		data: params,
		header: {
			'content-type': 'application/x-www-form-urlencoded'
		}
	})
}

export default {
	info,
	updateAvatar,
	updateUsername,
	bindEmail,
	unBindEmail,
	destroy,
	destroyRedirect,
	setPassword,
	updatePassword
}

